-
Notifications
You must be signed in to change notification settings - Fork 1
fix : 띱한사진 쿼리 무효화 #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix : 띱한사진 쿼리 무효화 #153
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @caseBread, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 사용자가 '좋아요' 기능과 상호작용한 후 좋아요한 사진 목록이 올바르게 업데이트되지 않던 문제를 해결합니다. 관련 쿼리를 무효화함으로써, 시스템은 표시되는 좋아요한 사진 목록이 항상 최신 상태를 유지하도록 보장하여 데이터 일관성과 사용자 경험을 향상시킵니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
이 PR은 사진에 '좋아요'를 누르거나 취소했을 때, '좋아요'한 사진 목록이 갱신되지 않는 버그를 수정합니다. handleDeepToggle 함수에 likedPhotos 쿼리를 무효화하는 로직을 추가하여 이 문제를 해결했습니다. 변경 사항은 정확하며, '좋아요' 상태 변경 후 관련 데이터가 올바르게 다시 로드되도록 보장합니다. 더 나은 사용자 경험을 위해, 추가적으로 쿼리 무효화 대신 낙관적 업데이트를 적용하는 방안에 대한 의견을 남겼습니다.
| queryClient.invalidateQueries({ | ||
| queryKey: [EP.album.likedPhotos(albumId)], | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 '좋아요'한 사진 목록을 무효화하는 방식은 서버로부터 데이터를 다시 가져오게 만들어 약간의 지연을 유발할 수 있습니다. 사용자 경험을 향상시키기 위해, album.photos 쿼리에 대해 updateCacheAlbumPhotosLike에서 수행하는 것처럼 album.likedPhotos 쿼리에 대해서도 낙관적 업데이트(optimistic update)를 적용하는 것을 고려해 보세요. 사진을 '좋아요'하면 목록에 추가하고, '좋아요'를 취소하면 목록에서 제거하는 방식으로 즉각적인 UI 피드백을 줄 수 있습니다. 이를 구현하려면 현재 사진의 전체 데이터가 필요할 수 있는데, album.photos 쿼리 캐시에서 해당 데이터를 찾아 활용할 수 있습니다.
요약
구현 사항
📸 스크린샷
Need Review
Reference
📜 리뷰 규칙
Reviewer는 아래 P5 Rule을 참고하여 리뷰를 진행합니다.
P5 Rule을 통해 Reviewer는 Reviewee에게 리뷰의 의도를 보다 정확히 전달할 수 있습니다.